<%--
  Created by IntelliJ IDEA.
  User: XiongMM
  Date: 2019/7/29
  Time: 下午2:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <title>全部用户详情</title>
    <style>
        .header{
            background-color: #06b6ef;
            height: 100px;
        }
        .bt1{
            line-height: 70px;
            margin-top: 10px;
            width: 500px;
            font-size: 30px;
            /*height: 200px;*/
        }
        .mod{
            /*background-color: orange;*/
            text-align: center;
            line-height: 40px;
            font-size: 30px;
            margin-top: 5px;
            padding: 10px;


        }
        .dxck{
            padding: 10px;
            width: 300px;
            color: ghostwhite;
        }
        .sc{
            line-height: 100%   ;
            height: 30px;
            width: 100px;
            margin-left: 100px;
        }
        .hide{
            display: none;
        }
        #show_msg{
            height: 350px;
            background-color: pink;
            position: fixed;
        }
        .xbnr{
            line-height: 100px;
            font-size: 80px;
        }
        input{
            font-size: 80px;
        }
        .close1{
            margin-left: 900px;
            font-size: 25px;

        }
        body{
            height: 1500px;
            background-color: black;
        }
    </style>
</head>
<body>
<div class="header" id="header">
    <button class="bt1">增加个人信息</button>
</div>
<div class="mod" id="mod">
    <table border="1">
        <tbody class="msg1" id="msg1">
        <tr>
            <th class="dxck">网名</th>
            <th class="dxck">姓名</th>
            <th class="dxck">年龄</th>
            <th class="dxck">邮箱</th>
            <th class="dxck">手机</th>
            <th class="dxck"></th>
        </tr>
        <c:if test="${!empty(users)}">
            <c:forEach var="user" items="${users}">
                <tr>
                    <td class="dxck">${user.userName}</td>
                    <td class="dxck">${user.trueName}</td>
                    <td class="dxck">${user.age}</td>
                    <td class="dxck">${user.email}</td>
                    <td class="dxck">${user.phone}</td>
                    <td class="dxck">
                        <button class="sc" onclick="updateUser('${user.userName}');">修改</button>
                        <c:if test="${user.userName != userName}">
                            <button class="sc" onclick="deleteUser('${user.userName}');">删除</button>
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </c:if>
        </tbody>
    </table>
</div>
</body>
<script>

    //增加个人信息
    var bt1 =document.getElementsByClassName("bt1")[0];
    bt1.onclick = function () {
        location.href = "/servlet/final/uiregister";
    };

    //删除用户
    function deleteUser(userName) {
        if (confirm("确认删除【"+userName+"】？")){
            location.href = "/servlet/final/deluser?userName="+userName;
        }else{
            return false;
        }
    }

    //修改用户
    function updateUser(userName) {
        if (confirm("确认修改【"+userName+"】？")){
            location.href = "/servlet/final/updateui?userName="+userName;
        }else{
            return false;
        }
    }
</script>
</html>
